package com.lizy.sential.demo.web;

import com.lizy.sential.demo.service.TestService;
import com.lizy.sential.demo.service.TestService2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Autowired
    private TestService service;

    @Autowired
    private TestService2 service2;
    @GetMapping(value = "/hello/{name}")
    public String apiHello(@PathVariable String name) {
        return service.sayHello(name);
    }


    @GetMapping(value = "/hello2/{name}")
    public String apiHello2(@PathVariable String name) {
        return service2.test2(name);
    }
}
